package com.system.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;

@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class RoleResourceDto implements Serializable {

    /**
    * id
    */
    private String id;

    /**
    * 角色|id
    */
    @NotEmpty(message = "角色|id必填")
    private String roleId;

    /**
    * 资源|id
    */
    @NotEmpty(message = "资源|id必填")
    private String resourceId;

    /**
    * 创建时间
    */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    public String getId() {
    return id;
    }

    public void setId(String id) {
    this.id = id;
    }

    public String getRoleId() {
    return roleId;
    }

    public void setRoleId(String roleId) {
    this.roleId = roleId;
    }

    public String getResourceId() {
    return resourceId;
    }

    public void setResourceId(String resourceId) {
    this.resourceId = resourceId;
    }

    public Date getCreateTime() {
    return createTime;
    }

    public void setCreateTime(Date createTime) {
    this.createTime = createTime;
    }


    @Override
    public String toString() {
        String sb = getClass().getSimpleName() +
                " [" +
                "Hash = " + hashCode() +
                ", id=" + id +
                ", roleId=" + roleId +
                ", resourceId=" + resourceId +
                ", createTime=" + createTime +
                "]";
        return sb;
        }

}